package ihm;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextField;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Ajout_Numero extends JFrame implements ActionListener
{

	private JPanel contentPane;
	private JTextField txtCodeAjtNum;
	private JLabel lblCodeAjtNum;
	private JTextField txtLibAjtNum;
	private JLabel lblLibAjtNum;
	private JButton btnAjouterAjtnum;
	private JButton btnAnnulerAjtNum;
	private JLabel lbltitre;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args)
	{
		EventQueue.invokeLater(new Runnable()
		{
			public void run()
			{
				try
				{
					Ajout_Numero frame = new Ajout_Numero();
					frame.setVisible(true);
				} catch (Exception e)
				{
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Ajout_Numero()
	{
		setTitle("Ajout d'un num\u00E9ro");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 504, 267);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		txtCodeAjtNum = new JTextField();
		txtCodeAjtNum.setBounds(132, 71, 118, 26);
		contentPane.add(txtCodeAjtNum);
		txtCodeAjtNum.setColumns(10);
		
		lblCodeAjtNum = new JLabel("Code num\u00E9ro :");
		lblCodeAjtNum.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblCodeAjtNum.setBounds(10, 72, 112, 20);
		contentPane.add(lblCodeAjtNum);
		
		txtLibAjtNum = new JTextField();
		txtLibAjtNum.setBounds(132, 120, 118, 26);
		contentPane.add(txtLibAjtNum);
		txtLibAjtNum.setColumns(10);
		
		lblLibAjtNum = new JLabel("Libell\u00E9 du num\u00E9ro :");
		lblLibAjtNum.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblLibAjtNum.setBounds(10, 121, 118, 20);
		contentPane.add(lblLibAjtNum);
		
		btnAjouterAjtnum = new JButton("Ajouter");
		btnAjouterAjtnum.setBounds(209, 192, 118, 26);
		contentPane.add(btnAjouterAjtnum);
		
		btnAnnulerAjtNum = new JButton("Annuler");
		btnAnnulerAjtNum.addActionListener(this);
		btnAnnulerAjtNum.setBounds(360, 192, 118, 26);
		contentPane.add(btnAnnulerAjtNum);
		
		lbltitre = new JLabel("Ajout d'un num\u00E9ro");
		lbltitre.setFont(new Font("Tahoma", Font.BOLD, 14));
		lbltitre.setBounds(179, 11, 148, 26);
		contentPane.add(lbltitre);
	}
	public void actionPerformed(ActionEvent arg0) 
	{
		if (arg0.getSource() == btnAnnulerAjtNum) 
		 {	
	       	 dispose(); 
		 }
	}
}
